﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JScriptSuite.QA.Lib.System
{
    class GuidTests
    {
        readonly static Guid guid1a = new Guid("{CD697F83-C661-4FE6-B3EC-ACA934D2C830}");
        readonly static Guid guid1b = new Guid("CD697F83-C661-4FE6-B3EC-ACA934D2C830");
        readonly static Guid guid2 = new Guid("{710326CC-9438-4083-BC5B-5447A21E7B32}");

        internal static JResultItem AllTests()
        {
            return JResultItem.CreateInstance("GuidTests")
                .Push(ConstantTests(), 
                    CompareTests());
        }

        static JResultItem ConstantTests()
        {
            return JResultItem.CreateInstance("ConstantTests")
                .Push(Guid.Empty.ToString(), 
                new Guid().ToString(), guid1a.ToString(), 
                guid1b.ToString(), guid2.ToString(), (new Guid[2])[1].ToString());
        }

        static JResultItem CompareTests()
        {
            return JResultItem.CreateInstance("CompareTests")
                .Push(Guid.Empty == new Guid(),
                Guid.Empty != new Guid(),
                guid1a == guid1b, guid1a == guid2,
                guid1a.Equals(guid1b), 
                guid1a.Equals(guid2),
                object.Equals(guid1a, guid1b), object.Equals(guid1a, guid2));
        }
    
    }
}
